type Error native;

export function Error:
    &(String) => Error
    native 'make-error';

export function Error:
    & { message: String, data: List[(String,String)] } => Error
    native 'make-error-with-data';

export function String:
    &(Error) => String
    native 'String from error';

export function get-data:
    &(Error,{key:String,fallback:String}) => String
    native 'error-get-data';

export function get-data:
    &(Error,String) => String
    &(err,key) => (err get-data { key, fallback: '' });

export function wrap:
    &(Error, &(String) => String) => Error
    native 'error-wrap';

